﻿@model PagedList.IPagedList<ITSTOREBLL.BaiViet>

@{
    ViewBag.Title = "Tin tức";
}

<h2>Tin tức</h2>

<table width="670">

@foreach (var item in Model) {
    <tr>
        <td colspan="3" style="color:#F00;font-size:larger">
            <a href="TinTuc/Details/@Html.DisplayFor(modelItem => item.bv_ID)?page=1" style="color:#F00">@Html.DisplayFor(modelItem => item.bv_TieuDe)</a>
        </td>
        <tr>
        <td style="font-size:smaller">
            Thuộc loại : @Html.DisplayFor(modelItem => item.LoaiBaiViet.lbv_Loai)
        </td>
        <td style="font-size:smaller">
            Ngày đăng : @Html.DisplayFor(modelItem => item.bd_Ngay)
        </td>
        <td style="font-size:smaller">
            @Html.ActionLink("Sửa", "Edit", new {id=item.bv_ID}) |
            @Html.ActionLink("Xóa", "Delete", new { id = item.bv_ID })
        </td>
        </tr>
    </tr>
}

</table>

<p>
    <a href="TinTuc/Create" style="color:Blue;font-size:20px">Thêm bài viết</a>
</p>
<div>
    Page @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber)
    of @Model.PageCount
     
    @if (Model.HasPreviousPage)
    {
        @Html.ActionLink("<<", "Index", new { page = 1, sortOrder = ViewBag.CurrentSort, currentFilter=ViewBag.CurrentFilter  })
        @Html.Raw(" ");
        @Html.ActionLink("< Prev", "Index", new { page = Model.PageNumber - 1, sortOrder = ViewBag.CurrentSort, currentFilter=ViewBag.CurrentFilter  })
    }
    else
    {
        @:<<
        @Html.Raw(" ");
        @:< Prev
    }
     
    @if (Model.HasNextPage)
    {
        @Html.ActionLink("Next >", "Index", new { page = Model.PageNumber + 1, sortOrder = ViewBag.CurrentSort, currentFilter=ViewBag.CurrentFilter  })
        @Html.Raw(" ");
        @Html.ActionLink(">>", "Index", new { page = Model.PageCount, sortOrder = ViewBag.CurrentSort, currentFilter=ViewBag.CurrentFilter  })
    }
    else
    {
        @:Next >
        @Html.Raw(" ")
        @:>>
    }
</div>